import { requestShp } from "@/utils/http";
import { IReqListRecord, IReqTrademarkList, IReqdelTrademark } from '../product/model/trademarkTypes'

/**
 * @description 获取品牌列表数据
 * @param page 页数
 * @param limit 一页展示几条数据
 * @returns Promise
 */
export const ReqBaseTrademark = (page:number,limit:number)=> {
    return requestShp.get<IReqTrademarkList>(`/admin/product/baseTrademark/${page}/${limit}`)
}

/**
 * @description 添加品牌数据
 * @returns  Promise
 */
export const ReqAddTrademark = (data:IReqListRecord)=> {
    return requestShp.post<IReqTrademarkList>('/admin/product/baseTrademark/save',data)
}

/**
 * @description 修改品牌数据
 * @param data id、品牌名称、品牌LOGO
 * @returns Promise
 */
export const ReqEditTrademark = (data:IReqListRecord)=> {
    return requestShp.put<IReqTrademarkList>('/admin/product/baseTrademark/update',data)
}

/**
 * @description 品牌详情
 * @param id
 * @returns 
 */
export const ReqTrademarkInfo = (id:number)=> {
    return requestShp.get<IReqListRecord>(`/admin/product/baseTrademark/get/${id}`)
}

/**
 * @description 删除品牌
 * @param id 
 * @returns 
 */
export const ReqDelTrademark = (id: number) => {
    // <IReqdelTrademark>
    return requestShp.delete<IReqdelTrademark>(`/admin/product/baseTrademark/remove/${id}`)
}
